<template>
  <div>
    <!-- 动态组件 -->
    <button @click="num = 1 - num">修改num</button>
    <!-- 动态组件：了解 -->
    <component :is="arr[num]"></component>
    <!-- <DrNum v-if="num === 0"></DrNum>
    <TestNum v-else></TestNum> -->
  </div>
</template>
<script>
import DrNum from '@/components/DrNum'
import TestNum from '@/components/TestNum'
export default {
  components: { DrNum, TestNum },
  data () {
    return {
      num: 0,
      arr: ['DrNum', 'TestNum']
    }
  }
}
</script>
<style></style>
